luci-base: network.js: recognize DSA ports and bridge VLANs
authorJo-Philipp Wich <[email protected]>
Thu, 18 Mar 2021 16:09:07 +0000 (17:09 +0100)
committerJo-Philipp Wich <[email protected]>
Thu, 18 Mar 2021 16:28:40 +0000 (17:28 +0100)
commitd1bf56d7f178f1b7582d7b3600ee70e65128ccfa
treec3ea0714a5e0b7ed9df618c68e1c557ac748a4f3
parent71feaa52857abb7408d657521c114319c1f0a113
luci-base: network.js: recognize DSA ports and bridge VLANs

Use the newly introduced devtype attribute for more robust network device
type detection. This also allows us to easily recognize DSA ports.

Furthermore, synthesize VLAN devices declared by uci bridge-vlan sections,
similar to how it is done for legacy swconfig switch_vlan ones.

Finally implement a new Network.Device.getParent() method to use the newly
available "parent" attribute to resolve the base device of DSA ports or
VLAN devices.

Signed-off-by: Jo-Philipp Wich <[email protected]>
modules/luci-base/htdocs/luci-static/resources/network.js